﻿using mozhi.smarterp.Finance.Enums;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Application.Dtos;

namespace mozhi.smarterp.Finance.Treasuries.Payments
{
    public class PaymentUpdateDto : EntityDto<Guid>
    {
        [Required]
        public DateTime Date { get; set; }

        [Required]
        public PaymentType Type { set; get; }

        public TradingPartnerType TradingPartnerType { set; get; }

        public Guid? SupplierId { set; get; }

        public Guid? EmployeeId { set; get; }

        public Guid? CustomerId { set; get; }

        [Required]
        public Guid BankAccountId { set; get; }

        [Required]
        public Guid CurrencyId { set; get; }

        [Required]
        public decimal ExchangeRate { set; get; }
        /// <summary>
        /// 是否预付款
        /// </summary>
        public bool IsAdvanced { set; get; }

        /// <summary>
        /// 是否退款
        /// </summary>
        public bool IsRefund { set; get; }

        public DocumentStatusType Status { set; get; }

        public string Comment { get; set; }


        public List<PaymentItemUpdateDto> Items { set; get; }
    }

    public class PaymentItemUpdateDto : EntityDto<Guid?>
    {
        public decimal? Amount { protected set; get; }

        [Required]
        public decimal AmountFr { protected set; get; }

        public string Remark { protected set; get; }

        public int Index { protected set; get; }
    }
}
